<include file="Public/header" /> 

<!--主窗体-->
<div class="container app">
	<!--左侧菜单-->
	<include file="Public/sidebar" /> 
	<!--左侧菜单//-->
	
	<!-- mainCon -->
	<div id="mainCon" class="mainCon">
		<h4>审核会员广告</h4>
		<form class="form-horizontal" id="myform" name="myform">
			<div class="form-group">
				<label for="title" class="col-sm-2 control-label">广告标题</label>
				<div class="col-sm-5">
					<input type="text" class="form-control" name="title" readonly="readonly" id="title" value="<{$info['title']}>" placeholder="广告标题">
				</div>
			</div>

			<div class="form-group">
				<label for="title" class="col-sm-2 control-label">会员广告图片</label>
				<div class="col-sm-5">
					<img src="<{$info['thumb']}>" style="width:150px;height:auto">
				</div>
			</div>

			<div class="form-group">
				<label for="title" class="col-sm-2 control-label">链接地址</label>
				<div class="col-sm-5">
					<input type="text" class="form-control" name="url" readonly="readonly" id="url" value="<{$info['url']}>" placeholder="链接地址">
				</div>
			</div>

			<if condition="$info['type'] eq 2">
				<div class="form-group">
					<label for="title" class="col-sm-2 control-label">视频链接</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" name="video_url" readonly="readonly" id="video_url" value="<{$info['video_url']}>" placeholder="视频链接">
					</div>
				</div>
			</if>

			<if condition="$info['type'] eq 4">
				<div class="form-group">
					<label for="title" class="col-sm-2 control-label">电话</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" name="phone" readonly="readonly" id="phone" value="<{$info['phone']}>" placeholder="电话">
					</div>
				</div>
			</if>
			
			<div class="form-group">
				<label for="title" class="col-sm-2 control-label">状态</label>
				<div class="col-sm-5">
					<div class="btn btn-default" disabled>
						<if condition="$info['status'] eq 1">
							可发布
						<elseif condition="$info['status'] eq -1"/>
							禁止发布
						</if>
					</div>
				</div>
			</div>
			
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<input type="hidden" name="id" value="<{$info['id']}>"/>
					<button  onclick="return pass(this)" data-status="1" class="btn btn-default col-sm-2">审核通过</button>
					<button  onclick="return pass(this)" data-status="-1" class="btn btn-default col-sm-2">审核不通过</button>
				</div>
			</div>
		</form>
		<input type='hidden' name="aid" id="aid" value="<{$info['id']}>">
	</div>
	<!-- mainCon// -->
	
</div>
<!--主窗体//-->

<script src="__PUBLIC__/js/layer/layer.js"></script>
<script src="__PUBLIC__/js/validate/jquery.validate.min.js"></script>
<script src="__PUBLIC__/js/validate/messages_zh.js"></script>
<script>
function pass(obj){
	var status = $(obj).attr('data-status');
	var aid    = $('#aid').val();
	
	if(status == 1){
		var text = "您确定该文章通过广告？";
	}else if(status == -1){
		var text = "您确定该文章不通过广告？";
	}
	
var index =	layer.confirm(text, {
		btn: ['确定','取消'] //按钮
	}, function(){
		$.post("<{:U('adCheckpass')}>",{id:aid,status:status},function(r){
			if(r.error == '0'){
				layer.alert(r.errmsg,{icon: 1},function(){
					window.location.href = r.url;
				});
			}else{
				layer.alert(r.errmsg,{icon: 2});
			}
		},'json');
	}, function(){
		layer.close(index);
	});

	return false;
}


</script>

<include file="Public/footer" /> 